<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .demo{
            background-color: red;
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
    <div class="demo">
    </div>
    <script>
    var div=document.querySelector("div");
    //手触摸
    div.addEventListener('touchstart',function(){
        console.log("触摸了");
    })
    //手移动
    div.addEventListener('touchmove',function(){
        console.log("移动了");
    })
    //手离开
    div.addEventListener('touchend',function(){
        console.log("离开了");
    })
    </script>
</body>
</html>